home *** CD-ROM | disk | FTP | other *** search
- { Tomasz Stanczak }
- { Hardenbergstr. 8 }
- { 31275 Lehrte }
- { Germany }
- { }
- { CIS ID: 100735,3273 }
-
- unit TestUnit;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, RtGauge, StdCtrls, ExtCtrls, Gauges,
- VBXCtrl, Bigauge;
-
- type
- TForm1 = class(TForm)
- RtGauge1: TRtGauge;
- Button1: TButton;
- Gauge1: TGauge;
- Button2: TButton;
- BiGauge1: TBiGauge;
- Button3: TButton;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Edit1: TEdit;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- private
- { Private-Deklarationen }
- InLoop1,InLoop2,InLoop3: Boolean;
- public
- { Public-Deklarationen }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- n,Cnt: longint;
- T: TDateTime;
- S: string;
- begin
- if InLoop1 then
- begin
- InLoop1 := False;
- exit;
- end;
- S := Button1.Caption;
- Button1.Caption := 'Stop';
- InLoop1 := True;
- Cnt := StrToInt(Edit1.Text);
- try
- T := Time;
- RtGauge1.MinValue := 0;
- RtGauge1.MaxValue := Cnt;
- for n:=0 to Cnt do
- begin
- RtGauge1.Value := n;
- Application.ProcessMessages;
- if not InLoop1 then
- abort;
- end;
- InLoop1 := False;
- finally
- Button1.Caption := S;
- Label1.Caption := FormatDateTime('hh:nn:ss',Time-T);
- end;
- end;
-
- procedure TForm1.Button2Click(Sender: TObject);
- var
- n,Cnt: longint;
- T: TDateTime;
- S: string;
- begin
- if InLoop2 then
- begin
- InLoop2 := False;
- exit;
- end;
- S := Button2.Caption;
- Button2.Caption := 'Stop';
- InLoop2 := True;
- Cnt := StrToInt(Edit1.Text);
- try
- T := Time;
- Gauge1.MinValue := 0;
- Gauge1.MaxValue := Cnt;
- for n:=0 to Cnt do
- begin
- Gauge1.Progress := n;
- Application.ProcessMessages;
- if not InLoop2 then
- exit;
- end;
- InLoop2 := False;
- finally
- Button2.Caption := S;
- Label2.Caption := FormatDateTime('hh:nn:ss',Time-T);
- end;
- end;
-
- procedure TForm1.Button3Click(Sender: TObject);
- var
- n,Cnt: longint;
- T: TDateTime;
- S: string;
- begin
- if InLoop3 then
- begin
- InLoop3 := False;
- exit;
- end;
- InLoop3 := True;
- S := Button3.Caption;
- Button3.Caption := 'Stop';
- Cnt := StrToInt(Edit1.Text);
- try
- T := Time;
- BiGauge1.Min := 0;
- BiGauge1.Max := Cnt;
- for n:=0 to Cnt do
- begin
- BiGauge1.Value := n;
- Application.ProcessMessages;
- if not InLoop3 then
- exit;
- end;
- InLoop3 := False;
- finally
- Button3.Caption := S;
- Label3.Caption := FormatDateTime('hh:nn:ss',Time-T);
- end;
- end;
-
- end.
-